<template>
  <view class="comp-a">
    <text class="comp-title">子组件A</text>
    <view class="value-group">
      <text>父组件传进来的值:</text>
      <text class="red-text">{{ intent }}</text>
    </view>
    <button @click="sendData()" class="comp-btn">传值给CompB组件</button>
  </view>
</template>

<script>
export default {
  props: ['intent'],
  methods: {
    sendData() {
		console.warn("----CompA----sendData------>"+this.intent);
      uni.$emit('getIntent', this.intent);
    }
  }
};
</script>

<style scoped>
.comp-a {
  background-color: orange;
  padding: 30rpx;
  border-radius: 10rpx;
}
.comp-title {
  display: block;
  font-size: 36rpx;
  font-weight: bold;
  margin-bottom: 20rpx;
}
.value-group {
  margin-bottom: 20rpx;
  font-size: 28rpx;
}
.red-text {
  color: red;
  font-weight: bold;
  margin-left: 10rpx;
}
.comp-btn {
  background-color: blue;
  color: #fff;
  border-radius: 8rpx;
  height: 80rpx;
}
</style>